package com.zc.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.stage.Stage;
import java.util.List;
import java.util.Map;

/**
 * Created by User on 2017/5/11.
 */
public class FXParamApp extends Application {

    public static void main(String[] args){
        Application.launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        //Get application parameters
        Parameters parameters = this.getParameters();
        Map<String, String> namedParams = parameters.getNamed();
        List<String> unnamedParams = parameters.getUnnamed();
        List<String> rawParams = parameters.getRaw();

        String paramStr = "Named Parmeters: " + namedParams + "\n"
                + "Unnamed Parameters: " + unnamedParams + "\n"
                + "Raw Parameters: " + rawParams;

        TextArea textArea = new TextArea(paramStr);
        Group root = new Group(textArea);
        primaryStage.setScene(new Scene(root));
        primaryStage.setTitle("Application Parameters");
        primaryStage.show();
    }
}
